GTK <= 3.20 allowed that but the CSS spec and borwsers do not.
We might want to just remove that feature, but for now, we just warn.
} while (_gtk_css_parser_try (parser, ",", TRUE));
+ if (linear->stops->len < 2)
+ {
+ _gtk_css_parser_error_full (parser,
+ GTK_CSS_PROVIDER_ERROR_DEPRECATED,
+ "Using one color stop with %s() is deprecated.",
+ linear->repeating ? "repeating-linear-gradient" : "linear-gradient");
+ }
+
if (!_gtk_css_parser_try (parser, ")", TRUE))
{
_gtk_css_parser_error (parser, "Missing closing bracket at end of linear gradient");
} while (_gtk_css_parser_try (parser, ",", TRUE));
+ if (radial->stops->len < 2)
+ {
+ _gtk_css_parser_error_full (parser,
+ GTK_CSS_PROVIDER_ERROR_DEPRECATED,
+ "Using one color stop with %s() is deprecated.",
+ radial->repeating ? "repeating-radial-gradient" : "radial-gradient");
+ }
+
if (!_gtk_css_parser_try (parser, ")", TRUE))
{
_gtk_css_parser_error (parser, "Missing closing bracket at end of radial gradient");